# RunJavaAsService.ps1

# Configuration
$JavaPath = "java.exe" # Path to java.exe
$JarPath = "lcc-acc-client-083003A.jar" # Path to your JAR file
$Args = "-Dprofile=localhost" # Any arguments for the Java program
$LogFile = "lcc-acc-client.log" # Log file path
$ErrorLogFile = "lcc-acc-clien-error.log" # Error log file path

# Run Java process in background
Start-Process -FilePath $JavaPath `
              -ArgumentList "  $Args -jar `"$JarPath`" " `
              -RedirectStandardOutput $LogFile `
              -RedirectStandardError $ErrorLogFile `
              -WindowStyle Hidden;

$JarPath0 = "lcc-sc-ftp-083003A.jar" # Path to your JAR file		
$LogFile0 = "lcc-sc-ftp.log" # Log file path
$ErrorLogFile0 = "lcc-sc-ftp-error.log" # Error log file path	

# Run Java process in background
Start-Process -FilePath $JavaPath `
              -ArgumentList "  $Args -jar `"$JarPath0`" " `
              -RedirectStandardOutput $LogFile0 `
              -RedirectStandardError $ErrorLogFile0 `
              -WindowStyle Hidden;
			  
$JarPath1 = "lcc-sc-server-083003A.jar" # Path to your JAR file		
$LogFile1 = "lcc-sc-server.log" # Log file path
$ErrorLogFile1 = "lcc-sc-server-error.log" # Error log file path	

# Run Java process in background
Start-Process -FilePath $JavaPath `
              -ArgumentList "  $Args -jar `"$JarPath1`" " `
              -RedirectStandardOutput $LogFile1 `
              -RedirectStandardError $ErrorLogFile1 `
              -WindowStyle Hidden;
			  
$JarPath2 = "lcc-batch-task-083003A.jar" # Path to your JAR file		
$LogFile2 = "lcc-batch-task.log" # Log file path
$ErrorLogFile2 = "lcc-batch-task-error.log" # Error log file path	

# Run Java process in background
Start-Process -FilePath $JavaPath `
              -ArgumentList "  $Args -jar `"$JarPath2`" " `
              -RedirectStandardOutput $LogFile2 `
              -RedirectStandardError $ErrorLogFile2 `
              -WindowStyle Hidden;
			  
$JarPath3 = "lcc-batch-task-job-083003A.jar" # Path to your JAR file		
$LogFile3 = "lcc-batch-task-job.log" # Log file path
$ErrorLogFile3 = "lcc-batch-task-job-error.log" # Error log file path	

# Run Java process in background
Start-Process -FilePath $JavaPath `
              -ArgumentList "  $Args -jar `"$JarPath3`" " `
              -RedirectStandardOutput $LogFile3 `
              -RedirectStandardError $ErrorLogFile3 `
              -WindowStyle Hidden;   

$JarPath4 = "lcc-batch-service-083004-M.jar" # Path to your JAR file		
$LogFile4 = "lcc-batch-service.log" # Log file path
$ErrorLogFile4 = "lcc-batch-service-error.log" # Error log file path	

# Run Java process in background
Start-Process -FilePath $JavaPath `
              -ArgumentList "  $Args -jar `"$JarPath4`" " `
              -RedirectStandardOutput $LogFile4 `
              -RedirectStandardError $ErrorLogFile4 `
              -WindowStyle Hidden;			  